package org.gpp.proj1.robot.action.step;


import junit.framework.TestCase;

public class DelayActionStepTest extends TestCase {
	public void testDelay() {
		DelayActionStep delayAction = new DelayActionStep( 1000 );
		
		assertEquals( 1000, delayAction.getMilliseconds() );
		
		long now = System.currentTimeMillis();
		delayAction.execute( null, null );
		long delay = System.currentTimeMillis() - now;
		
		// Not deterministic =(
		assertTrue( delay >= 1000 );
		assertTrue( delay < 1100 );
	}
}
